package com.swak.paxos.state;

import com.swak.paxos.Value;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

@Getter
@Setter
@Accessors(chain = true)
public class AcceptorState implements State {

	private BallotNumber promiseBallot = new BallotNumber(0);
	private BallotNumber acceptedBallot = new BallotNumber(0);
	private Value acceptedValue;

	public AcceptorState() {
		this.init();
	}

	public void init() {
		this.acceptedBallot.reset();
		this.acceptedValue = NONE;
	}

	/**
	 * acceptor启动 state初始化。
	 * 
	 * @param instanceID
	 * @return
	 * @throws Exception
	 */
	public int load() {

		return 0;
	}
}
